-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Úkol 2 - Aleš Kúdela #23
base: master
Are you sure you want to change the base?
Conversation
if (!$category) { | ||
throw new NotFoundHttpException("Kategorie neexistuje"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ty ponechané whitespacy, pryč (zde a :30)
} | ||
} | ||
|
||
/* public function renderShow($id, $page, $more = null, $order = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zakomentovaný kód většinou necommitujeme, nebo píšeme proč je zakomentovaný. Za půl roku nebudeš vědět proč tu je :)
|
||
$paginator = new PaginatorHelper; | ||
$products = $this->getDoctrine()->getRepository(Product::class)->countByCategory($category); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odsazení oproti zbytku kódu
$page = $request->query->get('page'); | ||
|
||
$paginator = new PaginatorHelper; | ||
$products = $this->getDoctrine()->getRepository(Product::class)->countAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odsazení oproti zbytku kódu
return [ | ||
"products" => $this->getDoctrine()->getRepository(Product::class)->findBy( | ||
[], | ||
[ | ||
"rank" => "desc" | ||
], | ||
21 | ||
$paginator->getLength(), | ||
$paginator->getOffset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odsazení oproti zbytku kódu
@@ -0,0 +1,256 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palec nahoru za použití knihovny odjinud 👍
') | ||
->setParameter("lft", $category->getLeft()) | ||
->setParameter("rgt", $category->getRight()); | ||
dump($query->getScalarResult()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zapomenutý debug výstup :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hej za mě úplně v pohodě řešení. Až na čistotu výstupu nemám výhrad. Možná to vypadá jako banalita, ale v tom kódu se po tobě musí vyznat další lidé. A proto je potřeba menší štábní kultura :)
Aleš